/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 14785
 * Date: 2025-07-09
 * Time: 23:53
 */
public class test {
    public static void func() {
        int[] array1 = new int[3];
        array1[0] = 10;
        array1[1] = 20;
        array1[2] = 30;
        int[] array2 = new int[]{1,2,3,4,5};
        array2[0] = 100;
        array2[1] = 200;
        array1 = array2;
        array1[2] = 300;
        array1[3] = 400;
        array2[4] = 500;
        for (int i = 0; i < array2.length; i++) {
            System.out.println(array2[i]);
        }
    }

//    public static void func() {
//        int a = 10;
//        int b = 20;
//        int[] arr = new int[]{1,2,3};
//    }
public static void main(String[] args) {
    int[] array = {1, 2, 3};
    for(int i = 0; i < array.length; ++i){
        System.out.println(array[i] + " ");
    }
}
    public static void main2(String[] args) {
        int[] array = {1, 2, 3};
        for (int x : array) {
            System.out.println(x);
        }
        int[] arr = null;
        System.out.println(arr[0]);


    }
    public static void main1(String[] args) {
        int[] array1;
        array1 = new int[10];
        int[] array2;
        array2 = new int[]{10, 20, 30};
        int[] array3 = {0,1,2,3,4,5,6,7,8,9};
        double[] array4 = {1.0, 2.0, 3.0, 4.0, 5.0};
        String[] array5 = {"hell", "Java", "!!!"};
        int[]array = new int[]{10, 20, 30, 40, 50};
        for(int i = 0; i < 5; i++){
            System.out.println(array[i]);
        }
//        int[]array = new int[]{10, 20, 30, 40, 50};
//        for(int i = 0; i < array.length; i++){
//            System.out.println(array[i]);
//        }

    }
}
